<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>	
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>	
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>	
<body >
<div>

<div id="content_div">
<header class="contHeader">
<input type="hidden" value="${synchronizeCookieStr}" id="synchronizeCookieStr" />
    <div class="contOHeader" style="z-index: 100">
        <h1>购物车</h1>
        <div class="contOHeadBack"><a href="javascript:history.go(-1);" ><img src="${staticPath}/images/back2.png"></a></div>
        <div class="contOHeadgwc"><a href="javascript:void(0)" id="delCartItems"  ><img src="${staticPath}/images/del.png"></a></div>   
    </div>
</header>
	<c:set var="storageId" value="-1"/>
	<div  id="empty_tip_div" class="weui_cells_title" style="display:${(cartItems== null || fn:length(cartItems) == 0)?'':'none'} " >
			<div class="index-pic"
					style="padding-top: 120px; text-align: center;">
					<img src="${staticPath}/images/empty-cart.png"
						style="width: 80px; height: 100px;">
			</div>
			<div style="text-align: center; width: 100%; color: #999;">
				<p>购物车中没有商品</p>
				<p>到处逛逛，将您心爱的商品加入购物车</p>
			</div>
			<div class="weui_btn_area">
				<a class="weui_btn weui_btn_primary" href="javascript:takeAstroll('/index.html');"
					id="showTooltips">去逛逛</a>
			</div>
	</div>
	<c:forEach items="${cartItems}" var="item">
	  <c:if test="${item.goods.storage.id!=storageId}">
	      <div class="weui_cells_title" id="storage_div${item.goods.storage.id}"><input type="checkbox" id="storage${item.goods.storage.id}" name="storage" value="${item.goods.storage.id}" style="float:left;margin-top:5px;margin-right:10px;"><p>${item.goods.storage.name}</p></div>
		  <c:set var="storageId" value="${item.goods.storage.id}"  />
	  </c:if>
     <input type="hidden" id="goods_price${item.sku.id}" value="${item.goodsPrice}"/>
     <input type="hidden" id="goods_id${item.sku.id}" value="${item.goods.id}"/>
      <div class="weui_cells weui_cells_access " id="sku_div${item.sku.id}" >
        <a class="weui_cell" href="javascript:;" style="border-bottom:#ddd 1px dashed;">
          <div class="weui_cell_hd" >
          	<input type="checkbox" ${item.isBuy==1?"checked='checked'":""} name="cart_item${storageId}" id="cart_item${item.sku.id}" value="${item.sku.id}" style="float:left;margin-top:5px;margin-right:10px;">
          	<img src="${item.goodsImage}" onclick="javascript:toGoodsDetail(this,'${item.sku.id}')" alt="" style="width:60px;height:60px;margin-right:5px;display:block" />
         </div>
          <div class="weui_cell_bd weui_cell_primary  goods_link_div" style="width:60% ">
            <p onclick="javascript:toGoodsDetail(this,'${item.sku.id}')" >${item.goodsName}<br/><span style="color:grey;">${item.sku.specName}</span> </p>
            <h4>
            	￥<fmt:formatNumber value="${item.goodsPrice/100}" pattern="0.00"/>
            	<span style="color:#ff6634;float: right;" id="goods_total${item.sku.id}" >￥<fmt:formatNumber value="${item.goodsPrice*item.goodsNum/100}" pattern="0.00"/></span>
            </h4>
            <input type="text" id="goods_num${item.sku.id}" name="goods_num${item.sku.id}" value="${item.goodsNum}"  class="spinner goods_num" />
          	
          </div>
        </a>
   <!-- 
        <div>
            <div class="tjleft">
	            <p>
	            	共<span id="num_span${item.sku.id}">${item.goodsNum}</span>件
	            </p>
	         </div>
            <div class="tjmid">
            <p>商品金额：</p>
            </div>
            <div class="tjright"><p style="color:#ff6634" id="goods_total${item.sku.id}" >￥<fmt:formatNumber value="${item.goodsPrice*item.goodsNum/100}" pattern="0.00"/></p></div>
        </div>
    -->
      </div>
	</c:forEach>
	<div style="clear: both;height: 43px;"></div>
   <div class="tabm" id="tabm_div" style="display:${(cartItems== null || fn:length(cartItems) == 0)?'none':''}">
     <h4 class="tableft"><input type="checkbox" id="all_check" name="all_check" style="float:left;margin-top:14px;margin-left:10px;margin-right:10px;">金额：<span class="tableft11" id="total_cost">￥0.00</span></h4>
     <a class="tabright" id="to_preorder"  href="javascript:void(0)" >结算</a>
   </div>
</div>	
</div>
</body>
